#include "BondOptionInfo.h"
#include <string.h>
#include <core/Utility.h>

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

#ifdef	_DEBUG
//#define	new	DEBUG_NEW
#endif

CBondOptionInfo::CBondOptionInfo() :m_CallStr(""), m_PutStr("")
{
	memset(m_BondKeyListedMarket, 0, sizeof(m_BondKeyListedMarket));
}

CBondOptionInfo::CBondOptionInfo(const CBondOptionInfo& info)
{
	memcpy(m_BondKeyListedMarket, info.m_BondKeyListedMarket, sizeof(m_BondKeyListedMarket));
	m_CallStr = info.m_CallStr;
	m_PutStr = info.m_PutStr;
}

CBondOptionInfo::~CBondOptionInfo()
{
}

void CBondOptionInfo::Clear()
{
	memset(m_BondKeyListedMarket, 0, sizeof(m_BondKeyListedMarket));
	m_CallStr.clear();
	m_PutStr.clear();
}

void CBondOptionInfo::SetCombBondKey(const char* sCombBondKey)
{
	FIELDCOPY(m_BondKeyListedMarket, sCombBondKey);
}

void CBondOptionInfo::SetCallStr(const char* sCallStr)
{
	m_CallStr = sCallStr ? sCallStr : "";
}

void CBondOptionInfo::SetPutStr(const char* sPutStr)
{
	m_PutStr = sPutStr ? sPutStr : "";
}

const char* CBondOptionInfo::GetCombBondKey() const
{
	return m_BondKeyListedMarket;
}

const char* CBondOptionInfo::GetCallStr() const
{
	return m_CallStr.c_str();
}
const char* CBondOptionInfo::GetPutStr() const
{
	return m_PutStr.c_str();
}
